package com.example.howard.xiao7music.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.example.howard.xiao7music.R;
import com.example.howard.xiao7music.ui.Activity.RemoteActivity.RankingListActivity;
import com.example.howard.xiao7music.ui.Activity.RemoteActivity.SearchSongActivity;

/**
 * Created by Howard on 2016/9/28.
 */
public class RemoteMainFragment extends Fragment {

    private RelativeLayout rankingsong;
    private RelativeLayout searchsong;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
            View view=inflater.inflate(R.layout.remote_main_fragment,null);

        rankingsong= (RelativeLayout) view.findViewById(R.id.net_ranking_view);
        searchsong= (RelativeLayout) view.findViewById(R.id.net_search_view);
        rankingsong.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent =new Intent(getActivity(),RankingListActivity.class);
                startActivity(intent);
            }
        });

        searchsong.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent =new Intent(getActivity(),SearchSongActivity.class);
                startActivity(intent);
            }
        });

        return view;
    }
}
